{extend name='base'/}
{block name='content'}
<ol class="breadcrumb" style="background-color: #f9f9f9;padding:8px 0;margin-bottom:10px;">
    <li>
        <a href=""><i class="fa fa-cogs"></i>
            规则管理</a>
    </li>
    <li class="active">
        <a href="{:url('index')}">规则列表</a>
    </li>
</ol>
<ul class="nav nav-tabs" role="tablist">
    <li ><a href="{:url('index')}">规则列表</a></li>
    <li class="active"><a href="{:url('add')}">规则添加</a></li>
</ul>
<form action="" method="POST" class="form-horizontal" role="form">
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">规则管理</h3>
        </div>
        <div class="panel-body">
            <div class="form-group">
                <label for="" class="col-sm-2 control-label">规则中文名称</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" name="title" value="{$oldData['title']}">
                </div>
            </div>
            <div class="form-group">
                <label for="" class="col-sm-2 control-label">规则标识</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" name="name" value="{$oldData['name']}">
                </div>
            </div>
            <div class="form-group">
                <label for="" class="col-sm-2 control-label">父规则</label>
                <div class="col-sm-10">
                    <select name="pid" id="inputID" class="form-control">
                        <option value="0">  顶级规则  </option>
                        {foreach name='field' item='v'}
                        <option value="{$v['id']}" {if condition="$v['id'] == $oldData['pid']"}selected{/if}>{$v['_title']}</option>
                        {/foreach}
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label for="" class="col-sm-2 control-label">附加规则</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" name="condition" value="{$oldData['condition']}">
                </div>
            </div>
            <div class="form-group">
                <label for="" class="col-sm-2 control-label">导航</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" name="nav" value="{$oldData['nav']}">
                </div>
            </div>
        </div>
    </div>
    <input type="text" hidden name="id" value="{:input('param.id')}">
    <button class="btn btn-primary">提交</button>
</form>


<script>
    function del(admin_id) {
        util.confirm('确认删除吗',function(){
            location.href = "{:url('del')}" + "?admin_id=" + admin_id;
        });
    }
</script>
{/block}